import store from "../../../store";
import ImageUtil from "../../../components/ImgUpload/helper/imageUtil";
import {
    SEND_IMG_DATA
} from "../../../config/postMessage-types";
export function gwWebviewActiveFn(result) {
    console.log("打印currentPath", store.state.gw.currentPath);
}

export default {
    [SEND_IMG_DATA]: (result) => {
        // console.log("result", result);
        let imgData = result.data.imgData;
        let id = result.data.id;
        // console.log("id", id);
        let currentFileArray = store.getters["gw/getFileArray"][id] || [];
        // console.log("currentFileArray1", [...currentFileArray]);
        currentFileArray.push(
            {
                uri: ImageUtil.getBlobFromBase64(imgData.data),
                data: imgData.data
            }
        );
        // console.log("currentFileArray2", currentFileArray);
        store.commit("gw/setFileArray", {[id]: currentFileArray});
    }
}